//
//  CFRMRecipeModel.swift
//  CrazyFatReducingMeal
//
//  Created by iOS-Czz on 2023/11/8.
//

import UIKit
class CFRMRecipeViewModel{
    var dataSource = [CFRMRecipeModel]()
}
extension CFRMRecipeViewModel{
    func getPageData(onSuccess: ((_ models: [CFRMRecipeModel]) ->Void)?){
        let dataHelper = CFRMRecipeModel.getUsingLKDBHelper()
        let sql = "select * from @t"
        let modelArr = dataHelper.search(withSQL: sql, to: CFRMRecipeModel.self) as! [CFRMRecipeModel]
        self.dataSource = modelArr
        onSuccess?(self.dataSource)
    }
}

@objcMembers
class CFRMRecipeModel: CFRMModel,Codable {
    var name = ""
    var breakfast = ""
    var lunch = ""
    var dinner = ""
    var isDefault = true
    override class func getTableName() -> String {
        return  String(describing: CFRMRecipeModel.self)
    }
}
